﻿@using KMF.Utility
@using KMF.WebUI.CustomHelpers
@using KMF.WebUI.Models
@model List<KMF.Common.ProductRateByCateTopListPagingDto>
@{
    ViewBag.Title = "ALLDiscountProduct";
    Layout = "~/Views/Shared/_Layout.cshtml";
   
}

<div class="slider">
    @Html.Action("BannerSlideOnHome", "Banner")
</div>
<div class="product_list">
    <div class="breadcrum">
        <a href="@Url.Action("Index", "Home", new { })l">Trang chủ </a>> <a href="@Url.Action("Index", "CategoryL1", new { })">Sản phẩm</a>> <a href="@Url.Action("ALLDiscountProduct", "Home", new { })">Hàng giảm giá</a>
    </div>
    <div class="menu_left">
        @Html.Action("MenuLeft", "CategoryL1")
    </div>
    <div class="product_list_cate">

        <div class="product_cate_title">
            <div class="cate_title">Hàng giảm giá<span>(@ViewBag.TotalRecod sản phẩm)</span></div>
            <input type="hidden" class="hidRecordByPage" value="@ViewBag.RecordByPage" />
            <ul class="litsCo ul">
                @*            <li>
                <a href="javascript:void(0);" rel="nofollow" idata="OEJHY">Hàng mới</a>
            </li>
            <li>
                <a href="javascript:void(0);" rel="nofollow" idata="ACCEH">Hàng sale</a>
            </li>*@
                <li>
                    <a href="javascript:void(0);" rel="nofollow" idata="GJUYR" class="active_type">Tất cả sản phẩm</a>
                </li>
            </ul>
        </div>
        @{     
            <div class="product_tab">
                @if (Model.Any())
                {
                    <ul>

                        @foreach (var item in Model)
                        {

                            var pDetailLink = Url.Action("Index", "ProductDetail", new { productId = item.Id, productName = StringUtil.RemoveSpecialCharactersVn(item.Name) });
                            using (Html.BeginForm("DiscountProduct", "Home", FormMethod.Post))
                            {
                            <li>
                                @Html.Hidden("productId", item.Id)
                                @Html.Hidden("productIdRoot", item.Id)
                                @Html.Hidden("productImagePath", item.ImagePath)
                                @Html.Hidden("rootPriceProduct", item.Price)
                                @Html.Hidden("promotionPrice", item.PromotionPrice)
                                <input type="hidden" name="productName" id="productName" value="@item.Name" />
                                <input type="hidden" value="1" name="productQuantity" id="productQuantity" />
                                @Html.Hidden("productStatus", item.ProductStatus)
                                @Html.Hidden("productColor")
                                @Html.Hidden("productColorCode")
                                @Html.Hidden("productSizeId")
                                @Html.Hidden("productSizeName")
                                @Html.Hidden("productSizePrice")
                                @Html.Hidden("promotionPercent", item.DiscountPercentage)
                                @Html.Hidden("decreasePrice", item.DiscountAmount)
                                @Html.Hidden("providerName", item.ProviderName)
                                @Html.Hidden("categoryId", item.CategoryId)

                                <div class="home_image">
                                    <a href="@pDetailLink">
                                        <img src="@item.ImagePath.ImagePathThumb(159, 243)" width="159" height="243" alt="@item.Name" class="lzLoading"/></a>
                                    @if (item.PromotionPrice > 0)
                                    {
                                        <span class="product_discount">-@item.DiscountPercentage.ToString("#.#")%</span>
                                    }

                                </div>
                                <a class="product_title" href="@pDetailLink">@item.Name</a>
                                <span class="home_price">@item.Price.ToString("##,###,###") đ</span>
                                <input type="submit" class="home_cart" /><a href="@pDetailLink" class="home_readmore"></a>
                            </li>
                            }
                        }

                    </ul>
                }
                else
                {
                    <div>Không có sản phẩm nào</div>
                }
            </div>
        }

    </div>






</div>
@section scripts{
    @Scripts.Render("~/bundles/bxSlide")
    @Styles.Render("~/Content/bxSlide")
    @Scripts.Render("~/bundles/categoryProduct")
<script type="text/javascript">
        var currentPage = "product";
    </script>
}